<?php
// this is the standard template data
$templateData = array(
                'title' => $this->title,
                'resourceUri' => $this->resourceUri,
                'description' => $this->description,
                'descriptionHelper' => $this->descriptionHelper,
                'options'           => $this->options
        );
?>
<div class="maincontent">
    <div class="section partner">
        <h3><?php echo $this->title ?></h3>
        <div class="section-content">
            <?php echo $this->partial( 'lod2/content.phtml', $templateData); ?>
            <?php if (isset($this->description['http://xmlns.com/foaf/0.1/homepage'][0]['value'])): ?>
            Homepage: <a href="<?php echo $this->description['http://xmlns.com/foaf/0.1/homepage'][0]['value'] ?>"><?php 
                echo $this->description['http://xmlns.com/foaf/0.1/homepage'][0]['value'] 
            ?></a>
            <?php endif; ?>
        </div>
    </div>
</div>


<?php // WORKPACKAGES

$query = '
PREFIX lod2: <http://lod2.eu/schema/>
PREFIX sysont: <http://ns.ontowiki.net/SysOnt/>
SELECT DISTINCT ?resourceUri
WHERE {
?resourceUri lod2:partner <'.$this->resourceUri.'> .
?resourceUri a lod2:WorkPackage.
?resourceUri sysont:order ?order.
FILTER (!isBLANK(?resourceUri))
}
ORDER BY ASC(?order)
​';

$workpackages = trim($this->querylist($query, 'lod2/items/li.phtml'));

?>

<?php // PROJECTS

$query = '
PREFIX lod2: <http://lod2.eu/schema/>
PREFIX doap: <http://usefulinc.com/ns/doap#>
SELECT DISTINCT ?resourceUri
WHERE {
?resourceUri lod2:partner <'.$this->resourceUri.'> .
?resourceUri a doap:Project.
FILTER (!isBLANK(?resourceUri))
}
​';

$projects = trim($this->querylist($query, 'lod2/items/li.phtml'));

?>

<?php if ($workpackages || $projects): ?>
<div class="subcolumns">

    <?php if ($workpackages): ?>

    <div class="c50l">
        <div class="subcl widget-deeplink">
            <h3>Workpackages</h3>
             <ul>
                <?php echo $workpackages ?>
             </ul>
        </div>
    </div>

    <?php endif; ?>

    <?php if ($projects): ?>

    <div class="c50l">
        <div class="subcr widget-deeplink">
            <h3>Technology Stack Projects</h3>
             <ul>
                <?php echo $projects ?>
             </ul>
        </div>
    </div>

    <?php endif; ?>

</div>
<?php endif; ?>
